<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This user guide is for Qi (version 1.3,
10 Sep 2019), which is a simple but well-integrated package manager.

Copyright (C) 2019 Matias Andres Fonzo, Santiago del Estero,
Argentina.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Qi user guide</title>

<meta name="description" content="Qi user guide">
<meta name="keywords" content="Qi user guide">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="#Index" rel="index" title="Index">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<h1 class="settitle" align="center">Qi user guide</h1>





<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>

<div class="contents">

<ul class="no-bullet">
  <li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a></li>
  <li><a name="toc-Invoking-qi-1" href="#Invoking-qi">2 Invoking qi</a></li>
  <li><a name="toc-The-qirc-file-1" href="#The-qirc-file">3 The qirc file</a></li>
  <li><a name="toc-Packages-1" href="#Packages">4 Packages</a>
  <ul class="no-bullet">
    <li><a name="toc-Package-conflicts" href="#Package-conflicts">4.1 Package conflicts</a></li>
    <li><a name="toc-Installing-packages" href="#Installing-packages">4.2 Installing packages</a></li>
    <li><a name="toc-Removing-packages" href="#Removing-packages">4.3 Removing packages</a></li>
    <li><a name="toc-Upgrading-packages" href="#Upgrading-packages">4.4 Upgrading packages</a>
    <ul class="no-bullet">
      <li><a name="toc-Package-blacklist" href="#Package-blacklist">4.4.1 Package blacklist</a></li>
    </ul></li>
  </ul></li>
  <li><a name="toc-Recipes-1" href="#Recipes">5 Recipes</a>
  <ul class="no-bullet">
    <li><a name="toc-Variables" href="#Variables">5.1 Variables</a></li>
    <li><a name="toc-Special-variables" href="#Special-variables">5.2 Special variables</a></li>
    <li><a name="toc-Writing-recipes" href="#Writing-recipes">5.3 Writing recipes</a></li>
    <li><a name="toc-Building-packages" href="#Building-packages">5.4 Building packages</a></li>
    <li><a name="toc-Variables-from-the-environment" href="#Variables-from-the-environment">5.5 Variables from the environment</a></li>
    <li><a name="toc-The-meta-file" href="#The-meta-file">5.6 The meta file</a></li>
  </ul></li>
  <li><a name="toc-Order-files-1" href="#Order-files">6 Order files</a></li>
  <li><a name="toc-Creating-packages-1" href="#Creating-packages">7 Creating packages</a></li>
  <li><a name="toc-Examining-packages-1" href="#Examining-packages">8 Examining packages</a></li>
  <li><a name="toc-Exit-status-1" href="#Exit-status">9 Exit status</a></li>
  <li><a name="toc-Index-1" href="#Index">Index</a></li>
</ul>
</div>


<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="SEC_Top"></a>

<p>This user guide is for Qi (version 1.3,
10 Sep 2019).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description and features of qi
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Invoking-qi" accesskey="2">Invoking qi</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command-line options
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-qirc-file" accesskey="3">The qirc file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Packages" accesskey="4">Packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Managing packages
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Recipes" accesskey="5">Recipes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Building packages
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Order-files" accesskey="6">Order files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Handling build order
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Creating-packages" accesskey="7">Creating packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Making Qi packages
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Examining-packages" accesskey="8">Examining packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Debugging purposes
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Exit-status" accesskey="9">Exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exit codes
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Index">Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<br>
<p>Copyright (C) 2019 Matias Fonzo.
</p>
<p>Qi&rsquo;s home page can be found at <a href="http://www.dragora.org">http://www.dragora.org</a>.
Send&nbsp;bug&nbsp;reports&nbsp;or&nbsp;suggestions&nbsp;to&nbsp;<a href="mailto:dragora-users@nongnu.org"><span class="nolinebreak">dragora-users</span>@nongnu.org</a>.<!-- /@w -->
</p>
<hr>
<a name="Introduction"></a>
<div class="header">
<p>
Next: <a href="#Invoking-qi" accesskey="n" rel="next">Invoking qi</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Introduction-1"></a>
<h2 class="chapter">1 Introduction</h2>
<a name="index-introduction"></a>

<p>Qi is a simple but well-integrated package manager.  It can create,
install, remove, and upgrade software packages.  Qi produces binary
packages using recipes, which are files containing specific instructions
to build each package from source.  Qi can manage multiple packages
under a single directory hierarchy.  This method allows to maintain a set
of packages and multiple versions of them.  This means that Qi could be
used as the main package manager or complement the existing one.
</p>
<p>Qi offers a friendly command line interface, a global configuration
file, a simple recipe layout to deploy software packages; also works
with binary packages in parallel, speeding up installations and packages
in production.  The format used for packages is a simplified but safe
POSIX pax archive compressed with lzip.
</p>
<p>Qi is a modern (POSIX-compliant) shell script released under the
terms of the GNU General Public License.  There are only two major
dependencies for the magic: graft(1) and tarlz(1), the rest is expected
to be found in any Unix-like system.
</p>
<hr>
<a name="Invoking-qi"></a>
<div class="header">
<p>
Next: <a href="#The-qirc-file" accesskey="n" rel="next">The qirc file</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Invoking-qi-1"></a>
<h2 class="chapter">2 Invoking qi</h2>
<a name="index-invocation"></a>

<p>This chapter describes the synopsis and command line options for
invoke Qi.
</p>
<div class="example">
<pre class="example">Usage: qi [<var>OPTION</var>]... [<var>FILE</var>]...
</pre></div>

<p>One mandatory option specifies the operation that &lsquo;<samp>qi</samp>&rsquo; should
perform, other options are meant to detail how this operation should be
performed.
</p>
<p>qi supports the following options to operate:
</p>
<dl compact="compact">
<dt><code>-b</code></dt>
<dd><p>Build package using recipe names.
</p>
</dd>
<dt><code>-c</code></dt>
<dd><p>Create .tlz package from directory.
</p>
</dd>
<dt><code>-d</code></dt>
<dd><p>Delete packages.
</p>
</dd>
<dt><code>-i</code></dt>
<dd><p>Install packages.
</p>
</dd>
<dt><code>-o</code></dt>
<dd><p>Resolve build order through .order files.
</p>
</dd>
<dt><code>-u</code></dt>
<dd><p>Update packages (implies -i, -d and -p options).
</p>
</dd>
<dt><code>-w</code></dt>
<dd><p>Warn about files that will be linked.
</p>
</dd>
<dt><code>-x</code></dt>
<dd><p>Extract a package for debugging purposes.
</p></dd>
</dl>

<p>There are common options between modes:
</p>
<dl compact="compact">
<dt><code>-N</code></dt>
<dd><p>Do not read the configuration file.
</p>
<p>This will ignore any value in the qirc file.
</p>
</dd>
<dt><code>-P &lt;DIR&gt;</code></dt>
<dd><p>Package directory for installations.
</p>
<p>This option sets &lsquo;<samp>${packagedir}</samp>&rsquo;.
</p>
<p>Only valid for -i, -d, or -u options.
</p>
</dd>
<dt><code>-f</code></dt>
<dd><p>Force option.
</p>
<p>This option can force the build of a recipe, or force the update of a
pre-existing package.
</p>
<p>Only valid for -b, -u options.
</p>
</dd>
<dt><code>-t &lt;DIR&gt;</code></dt>
<dd><p>Target directory for symbolic links.
</p>
<p>This option sets &lsquo;<samp>${targetdir}</samp>&rsquo;.
</p>
<p>Only valid for -i, -d, or -u options.
</p>
</dd>
<dt><code>-k</code></dt>
<dd><p>Keep (don&rsquo;t delete) &lsquo;<samp>${srcdir}</samp>&rsquo; or &lsquo;<samp>${destdir}</samp>&rsquo; in build
mode, keep (don&rsquo;t delete) package directory in delete mode.
</p>
<p>Only valid for -b, -d or -u options.
</p>
</dd>
<dt><code>-p</code></dt>
<dd><p>Prune conflicts on package installations.
</p>
<p>This option may proceed with the package installation if one or more
conflicts occur.
</p>
</dd>
<dt><code>-r /rootdir</code></dt>
<dd><p>Use the fully qualified named directory as the root directory for all qi
operations.  The target directory and package directory will be relative
to the specified directory, including the log file for graft.
</p>
</dd>
<dt><code>-v</code></dt>
<dd><p>Be verbose (a 2nd -v gives more).
</p></dd>
</dl>

<p>Options for build mode (-b):
</p>
<dl compact="compact">
<dt><code>-O &lt;DIR&gt;</code></dt>
<dd><p>Where the packages produced are written.
</p>
<p>This option sets &lsquo;<samp>${outdir}</samp>&rsquo;.
</p>
</dd>
<dt><code>-W &lt;DIR&gt;</code></dt>
<dd><p>Where archives, patches, and recipes are expected.
</p>
<p>This option sets &lsquo;<samp>${worktree}</samp>&rsquo;.
</p>
</dd>
<dt><code>-Z &lt;DIR&gt;</code></dt>
<dd><p>Where (compressed) sources will be found.
</p>
<p>This option sets &lsquo;<samp>${tardir}</samp>&rsquo;.
</p>
</dd>
<dt><code>-a</code></dt>
<dd><p>Architecture to use.
</p>
<p>Default value is obtained via uname(1) as &lsquo;<samp>uname -m</samp>&rsquo;.
</p>
</dd>
<dt><code>-j</code></dt>
<dd><p>Parallel jobs for the compiler.
</p>
<p>If not specified, default sets to 1.
</p>
</dd>
<dt><code>-1</code></dt>
<dd><p>Increment release number (&lsquo;<samp>${release}</samp>&rsquo; + 1).
</p>
<p>It will be omitted if the -n option is being used.
</p>
</dd>
<dt><code>-n</code></dt>
<dd><p>Don&rsquo;t create a .tlz package.
</p>
</dd>
<dt><code>-S</code></dt>
<dd><p>Selects the option to skip completed recipes.
</p>
<p>This means, in interactive mode, when the dialog
to summarize recipes is shown.
</p></dd>
</dl>

<p>Informative options:
</p>
<dl compact="compact">
<dt><code>-L</code></dt>
<dd><p>Print default directory locations.
</p>
<p>This will print the target directory, package directory, working tree,
the directory for tarballs, and the output directory for the packages
produced.
</p>
</dd>
<dt><code>-h</code></dt>
<dd><p>Display the help describing the options and then exit.
</p>
</dd>
<dt><code>-V</code></dt>
<dd><p>Print the version number and license information.
The version number should be included in all bug reports.
</p></dd>
</dl>

<p>Expected non-option arguments are package directories and regular files:
recipes or files ending in .tlz, .order.  When FILE is -, qi can read from
the standard input.  See examples in <a href="#Packages">Packages</a>.
</p>

<hr>
<a name="The-qirc-file"></a>
<div class="header">
<p>
Next: <a href="#Packages" accesskey="n" rel="next">Packages</a>, Previous: <a href="#Invoking-qi" accesskey="p" rel="prev">Invoking qi</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="The-qirc-file-1"></a>
<h2 class="chapter">3 The qirc file</h2>
<a name="index-configuration-file"></a>

<p>The global <samp>qirc</samp> file offers a way to define variables and tools
(such as a download manager) for default use.  This file is used by qi
at runtime, e.g., to build, install, remove or upgrade packages.
</p>
<p>It has the following rules:
</p>
<ul>
<li> Variables must be declared as &lsquo;<samp>name=value</samp>&rsquo;.

</li><li> Declaration of values should only take one line, no line break.

</li><li> For security reasons, assignments like &lsquo;<samp>name=$var</samp>&rsquo; are only
interpreted as literal.
</li></ul>

<p>The command line options related to the package directory and target
directory plus some of the options used for the build mode can override
some values in <samp>qirc</samp>.  See <a href="#Invoking-qi">Invoking qi</a>.
</p>
<p>The order in which qi looks for this file is:
</p>
<ol>
<li> <code>${HOME}/.qirc</code>
 Effective user.

</li><li> &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo;
 System-wide.
</li></ol>

<p>If you intend to run qi as effective user, the file
&lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo; could be copied to <code>${HOME}/.qirc</code>
setting the paths for &lsquo;<samp>${packagedir}</samp>&rsquo; and &lsquo;<samp>${targetdir}</samp>&rsquo;
according to the <code>$HOME</code>.
</p>

<hr>
<a name="Packages"></a>
<div class="header">
<p>
Next: <a href="#Recipes" accesskey="n" rel="next">Recipes</a>, Previous: <a href="#The-qirc-file" accesskey="p" rel="prev">The qirc file</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Packages-1"></a>
<h2 class="chapter">4 Packages</h2>
<a name="index-managing-packages"></a>

<p>A package is a suite of programs usually distributed in binary form
which may also contain manual pages, documentation, or any other file
associated to a specific software.
</p>
<p>The package format used by qi is a simplified POSIX pax archive
compressed with lzip.  The file extension for packages is &lsquo;<samp>.tlz</samp>&rsquo;.
</p>
<p>Both package installation and package de-installation are managed using
two important (internal) variables: &lsquo;<samp>${packagedir}</samp>&rsquo; and
&lsquo;<samp>${targetdir}</samp>&rsquo;, these values can be changed in the
configuration file or via options.
</p>
<p>&lsquo;<samp>${packagedir}</samp>&rsquo; is a common directory tree where the package
contents will be decompressed (will reside).
</p>
<p>&lsquo;<samp>${targetdir}</samp>&rsquo; is a target directory where the links will be
made by graft(1) taking &lsquo;<samp>${packagedir}/package_name</samp>&rsquo; into account.
</p>
<p>Packages are installed in self-contained directory trees and symbolic
links from a common area are made to the package files.  This allows
multiple versions of the same package to coexist on the same system.
</p>
<a name="Package-conflicts"></a>
<h3 class="section">4.1 Package conflicts</h3>
<a name="index-package-conflicts"></a>

<p>All the links to install or remove a package are handled by graft(1).
Since multiple packages can be installed or removed at the same time,
certain conflicts may arise between the packages.
</p>
<p>graft<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>
defines a CONFLICT as one of the following conditions:
</p>
<ul>
<li> If the package object is a directory and the target object exists but is
not a directory.

</li><li> If the package object is not a directory and the target object exists
and is not a symbolic link.

</li><li> If the package object is not a directory and the target object exists
and is a symbolic link to something other than the package object.
</li></ul>

<p>The default behavior of qi for an incoming package is to ABORT if a
conflict arises.  When a package is going to be deleted, qi tells to
graft(1) to remove those parts that are not in conflict, leaving the
links to the belonging package.  This behavior can be forced if the
-p option is given.
</p>
<a name="Installing-packages"></a>
<h3 class="section">4.2 Installing packages</h3>
<a name="index-package-installation"></a>

<p>To install a single package, simply type:
</p>
<div class="example">
<pre class="example">qi -i coreutils-8.30-i586+1.tlz
</pre></div>

<p>To install multiple packages at once, type:
</p>
<div class="example">
<pre class="example">qi -i gcc-8.3.0-i586+1.tlz rafaela-2.2-i586+1.tlz ...
</pre></div>

<p>Warn about the files that will be linked:
</p>
<div class="example">
<pre class="example">qi -w bash-5.0-i586+1.tlz
</pre></div>

<p>This is to verify the content of a package before installing it.
</p>
<p>See the process of an installation (very verbose):
</p>
<div class="example">
<pre class="example">qi -i -v mariana-3.0-i586+1.tlz
</pre></div>

<p>A second -v gives more.
</p>
<p>Installing package in a different location:
</p>
<div class="example">
<pre class="example">qi -r /media/floppy -i lzip-1.21-i586+1.tlz
</pre></div>

<p>The -r option assumes &lsquo;<samp>${targetdir}</samp>&rsquo; and &lsquo;<samp>${packagedir}</samp>&rsquo;.
See:
</p>
<div class="example">
<pre class="example">qi -r /home/selk -P /pkgs -t / -i lzip-1.21-i586+1.tlz
</pre></div>

<p>In this case the content of &quot;lzip-1.21-i586+1.tlz&quot; will be decompressed
into &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1</samp>&rsquo;.  Assuming that the main
binary for lzip is under &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1/usr/bin/</samp>&rsquo;
the target for &quot;usr/bin&quot; will be created at &lsquo;<samp>/home/selk</samp>&rsquo;.  Considering
that you have exported the <code>PATH</code> as &lsquo;<samp>${HOME}/usr/bin</samp>&rsquo;, now the
system is able to see the recent lzip.
</p>
<p>Installing from a list of packages using standard input:
</p>
<div class="example">
<pre class="example">cat FILELIST.txt | qi -i -
</pre></div>

<p>The list of packages must contain full path names to be passed in the
installation, e.g.:
/var/cache/qi/packages/x86_64/devel/tcl-8.6.9-x86_64+1.tlz
/var/cache/qi/packages/x86_64/devel/tk-8.6.9.1-x86_64+1.tlz
/var/cache/qi/packages/x86_64/devel/vala-0.42.3-x86_64+1.tlz
</p>
<a name="Removing-packages"></a>
<h3 class="section">4.3 Removing packages</h3>
<a name="index-package-de_002dinstallation"></a>

<p>To remove a package, simply type:
</p>
<div class="example">
<pre class="example">qi -d xz-5.2.4-i586+1.tlz
</pre></div>

<p>Delete mode will match the package name using &lsquo;<samp>${packagedir}</samp>&rsquo; as
prefix.  For example, if the value of &lsquo;<samp>${packagedir}</samp>&rsquo; is set to
/usr/local/pkgs, this will be equal to:
</p>
<div class="example">
<pre class="example">qi -d /usr/local/pkgs/xz-5.2.4-i586+1
</pre></div>

<p>Detailed output (very verbose):
</p>
<div class="example">
<pre class="example">qi -d -v /usr/local/pkgs/xz-5.2.4-i586+1
</pre></div>

<p>A second -v gives more.
</p>
<p>By default the delete mode does not preserve a package directory after
removing its links from &lsquo;<samp>${targetdir}</samp>&rsquo;, but this behavior can be
changed if the -k option is passed:
</p>
<div class="example">
<pre class="example">qi -d -k /usr/local/pkgs/lzip-1.21-i586+1
</pre></div>

<p>This means that the links to the package can be reactivated, later:
</p>
<div class="example">
<pre class="example">cd /usr/local/pkgs &amp;&amp; graft -i lzip-1.21-i586+1
</pre></div>

<p>Removing package from a different location:
</p>
<div class="example">
<pre class="example">qi -r /home/cthulhu -P /pkgs -t / -d xz-5.2.4-i586+1
</pre></div>

<p>Removing a package using standard input:
</p>
<div class="example">
<pre class="example">echo &quot;vala-0.42.3-x86_64+1&quot; | qi -d -
</pre></div>

<p>This will match with the package directory.
</p>
<a name="Upgrading-packages"></a>
<h3 class="section">4.4 Upgrading packages</h3>
<a name="index-package-upgrade"></a>

<p>The upgrade mode inherits the properties of the installation and removal
process.  To make sure that a package is updated, the package is installed
in a temporary directory taking &lsquo;<samp>${packagedir}</samp>&rsquo; into account.  Once
the incoming package is pre-installed, qi can proceed to search and delete
packages that have the same name (considered as previous ones).  Finally,
the package is re-installed at its final location and the temporary
directory is removed.
</p>
<p>To upgrade a package, just type:
</p>
<div class="example">
<pre class="example">qi -u gcc-9.0.1-i586+1.tlz
</pre></div>

<p>This will proceed to update &quot;gcc-9.0.1-i586+1&quot; removing other versions
of &quot;gcc&quot; (if any).
</p>
<p>If you want to keep the package directories of versions found during the
upgrade process, just pass:
</p>
<div class="example">
<pre class="example">qi -u -k gcc-9.0.1-i586+1.tlz
</pre></div>

<p>To see the upgrade process (very verbose):
</p>
<div class="example">
<pre class="example">qi -u -v gcc-9.0.1-i586+1.tlz
</pre></div>

<p>A second -v gives more.
</p>
<p>To force the upgrade of an existing package:
</p>
<div class="example">
<pre class="example">qi -u -f gcc-9.0.1-i586+1.tlz
</pre></div>

<a name="Package-blacklist"></a>
<h4 class="subsection">4.4.1 Package blacklist</h4>
<a name="index-package-blacklist"></a>

<p>To implement general package facilities, either to install, remove or
maintain the hierarchy of packages in a clean manner, qi makes use of the
pruning operation via graft(1):
</p>
<p>There is a risk if those are crucial packages for the proper functioning
of the system, because it implies the deactivation of symbolic from the
target directory, <em>especially</em> when transitioning an incoming package
into its final location during upgrade.
</p>
<p>A blacklist of package names has been devised for the case where
a user decides to upgrade all packages in the system, or
just the crucial ones, such as the C library.
</p>
<p>The blacklist is related to the upgrade mode only, consists in installing
a package instead of updating it or removing previous versions of it;
the content of the package will be updated over the existing content at
&lsquo;<samp>${packagedir}</samp>&rsquo;, while the existing links from
&lsquo;<samp>${targetdir}</samp>&rsquo; will be preserved.  A pruning of links will be
carried out in order to re-link possible differences with the recent
content, this helps to avoid leaving dead links in the target directory.
</p>
<p>Since the upgrade mode is also used to install a new package, the mechanism
for blacklist is to install a declared package if it does not already
exist.  If it already exists, it is verified that the binary package is
newer than the package directory in order to perform an update.
</p>
<p>Package names for the blacklist can be set from the configuration file.
</p>

<hr>
<a name="Recipes"></a>
<div class="header">
<p>
Next: <a href="#Order-files" accesskey="n" rel="next">Order files</a>, Previous: <a href="#Packages" accesskey="p" rel="prev">Packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Recipes-1"></a>
<h2 class="chapter">5 Recipes</h2>
<a name="index-recipes"></a>

<p>A recipe is a file telling qi what to do.  Most often, the recipe tells
qi how to build a binary package from a source tarball.
</p>
<p>A recipe has two parts: a list of variable definitions and a list of
sections.  By convention, the syntax of a section is:
</p>
<div class="example">
<pre class="example">section_name()
{
    section lines
}
</pre></div>

<p>The section name is followed by parentheses, one newline and an opening
brace.  The line finishing the section contains just a closing brace.
The section names or the function names currently recognized are
&lsquo;<samp>build</samp>&rsquo;.
</p>
<p>The &lsquo;<samp>build</samp>&rsquo; section is an augmented shell script.  This is the main
section (or <strong>shell function</strong>) which contains the instructions to
build and produce a package.
</p>
<a name="Variables"></a>
<h3 class="section">5.1 Variables</h3>
<a name="index-variables"></a>

<p>A &quot;variable&quot; is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
or in a recipe to represent a string of text, called the variable&rsquo;s
&quot;value&quot;.  These values are substituted by explicit request in the
definitions of other variables or in calls to external commands.
</p>
<p>Variables can represent lists of file names, options to pass to
compilers, programs to run, directories to look in for source files,
directories to write output to, or anything else you can imagine.
</p>
<p>Definitions of variables in qi have four levels of precedence.
Options which define variables from the command-line override those
specified in the <samp>qirc</samp> file, while variables defined in the recipe
override those specified in <samp>qirc</samp>, taking priority over those
variables set by command-line options.  Finally, the variables have
default values if they are not defined anywhere.
</p>
<p>Options that set variables through the command-line can only reference
variables defined in <samp>qirc</samp> and variables with default values.
</p>
<p>Definitions of variables in <samp>qirc</samp> can only reference variables
previously defined in <samp>qirc</samp> and variables with default values.
</p>
<p>Definitions of variables in the recipe can only reference variables
set by the command-line, variables previously defined in the recipe,
variables defined in <samp>qirc</samp>, and variables with default values.
</p>
<a name="Special-variables"></a>
<h3 class="section">5.2 Special variables</h3>
<a name="index-special-variables"></a>

<p>There are variables which can only be set using the command line options or
via <samp>qirc</samp>, there are other special variables which can be defined or
redefined in a recipe.  See the following definitions:
</p>
<p>&lsquo;<samp>outdir</samp>&rsquo; is the directory where the packages produced are written.
This variable can not be redefined in the recipe.  Default sets to
&lsquo;<samp>/var/cache/qi/packages</samp>&rsquo;.
</p>
<p>&lsquo;<samp>worktree</samp>&rsquo; is the working tree where archives, patches, and recipes
are expected.  This variable can not be redefined in the recipe.  Default
sets to &lsquo;<samp>/usr/src/qi</samp>&rsquo;.
</p>
<p>&lsquo;<samp>tardir</samp>&rsquo; is defined in the recipe to the directory where the tarball
containing the source can be found.  The full name of the tarball is
composed as &lsquo;<samp>${tardir}/$tarname</samp>&rsquo;.  Its value is available in the
recipe as &lsquo;<samp>${tardir}</samp>&rsquo;; a value of . for &lsquo;<samp>tardir</samp>&rsquo; sets it to
the value of CWD (Current Working Directory), this is where the recipe
lives.
</p>
<p>&lsquo;<samp>arch</samp>&rsquo; is the architecture to compose the package name.  Its value is
available in the recipe as &lsquo;<samp>${arch}</samp>&rsquo;.  Default value is the output
of &lsquo;<samp>uname -m</samp>&rsquo;.
</p>
<p>&lsquo;<samp>jobs</samp>&rsquo; is the number of parallel jobs to pass to the compiler.  Its
value is available in the recipe as &lsquo;<samp>${jobs}</samp>&rsquo;.  The default value
is 1.
</p>
<p>The two variables &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; can be
set in the recipe, as any other variable, but if they are not, qi uses
default values for them when building a package.
</p>
<p>&lsquo;<samp>srcdir</samp>&rsquo; contains the source code to be compiled, and defaults to
&lsquo;<samp>${program}-${version}</samp>&rsquo;.  &lsquo;<samp>destdir</samp>&rsquo; is the place where the
built package will be installed, and defaults to
&lsquo;<samp>${TMPDIR}/package-${program}</samp>&rsquo;.
</p>
<p>If &lsquo;<samp>pkgname</samp>&rsquo; is left undefined, the special variable &lsquo;<samp>program</samp>&rsquo;
is assigned by default.  If &lsquo;<samp>pkgversion</samp>&rsquo; is left undefined, the
special variable &lsquo;<samp>version</samp>&rsquo; is assigned by default.
</p>
<p>&lsquo;<samp>pkgname</samp>&rsquo; and &lsquo;<samp>pkgversion</samp>&rsquo; along with: &lsquo;<samp>version</samp>&rsquo;, &lsquo;<samp>arch</samp>&rsquo;,
and &lsquo;<samp>release</samp>&rsquo; are used to produce the name of the package in the form:
&lsquo;<samp>${pkgname}-${pkgversion}-${arch}+${release}.tlz</samp>&rsquo;
</p>
<p>A special variable called &lsquo;<samp>replace</samp>&rsquo; can be used to declare package
names that will be replaced at the time of installation.
</p>
<p>A typical recipe contains the following variables:
</p>
<ul>
<li> &lsquo;<samp>program</samp>&rsquo;: software name.

<p>It matches the source name.  It is also used to compose the name of the
package if &lsquo;<samp>${pkgname}</samp>&rsquo; is not specified.
</p>
</li><li> &lsquo;<samp>version</samp>&rsquo;: software version.

<p>It matches the source name.  It is also used to compose the version of the
package if &lsquo;<samp>${pkgversion}</samp>&rsquo; is not specified.
</p>
</li><li> &lsquo;<samp>arch</samp>&rsquo;: software architecture.

<p>It is used to compose the architecture of the package in which it is
build.
</p>
</li><li> &lsquo;<samp>release</samp>&rsquo;: release number.

<p>This is used to reflect the release number of the package.  It is
recommended to increase this number after any significant change in
the recipe or post-install script.
</p></li></ul>

<p>Obtaining sources over the network must be declared in the recipe using
the &lsquo;<samp>fetch</samp>&rsquo; variable.  Use double quotes for separated values.
</p>
<p>The variables &lsquo;<samp>netget</samp>&rsquo; and &lsquo;<samp>rsync</samp>&rsquo; can be defined in <samp>qirc</samp>
to establish a network downloader in order to get the sources.  If they
are not defined, qi uses default values:
</p>
<p>&lsquo;<samp>netget</samp>&rsquo; is the general network downloader tool, defaults sets to
&lsquo;<samp>wget -c -w1 -t3 --no-check-certificate</samp>&rsquo;.
</p>
<p>&lsquo;<samp>rsync</samp>&rsquo; is the network tool for sources containing the prefix for
the RSYNC protocol, default sets to
&lsquo;<samp>rsync -v -a -L -z -i --progress</samp>&rsquo;.
</p>
<p>The variable &lsquo;<samp>description</samp>&rsquo; is used to print the package description
when a package is installed.
</p>
<p>A description has two parts: a brief description, and a long description.
By convention, the syntax of &lsquo;<samp>description</samp>&rsquo; is:
</p>
<div class="example">
<pre class="example">description=&quot;
Brief description.

Long description.
&quot;
</pre></div>

<p>The first line of the value represented is a brief description of the
software (called &quot;blurb&quot;).  A blank line separates the <em>brief
description</em> from the <em>long description</em>, which should contain a more
descriptive description of the software.
</p>
<p>An example looks like:
</p>
<div class="example">
<pre class="example">description=&quot;
The GNU core utilities.

The GNU core utilities are the basic file, shell and text manipulation
utilities of the GNU operating system.  These are the core utilities
which are expected to exist on every operating system.
&quot;
</pre></div>

<p>Please consider a length limit of 78 characters as maximum, because the same
one would be used on the meta file creation.  See
<a href="#Recipes">The meta file</a> section.
</p>
<p>The &lsquo;<samp>homepage</samp>&rsquo; variable is used to declare the main site or home page:
</p>
<div class="example">
<pre class="example">homepage=http://www.gnu.org/software/gcc
</pre></div>

<p>The variable &lsquo;<samp>license</samp>&rsquo; is used for license information<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>.
Some code in the program can be covered by license A, license B, or
license C.  For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a conjunction
(if that ever happens in a significant way), and comma for heterogeneous
licensing.  Comma would have lower precedence, plus added special terms.
</p>
<div class="example">
<pre class="example">license=&quot;LGPL, GPL | Artistic + added permission&quot;
</pre></div>

<a name="Writing-recipes"></a>
<h3 class="section">5.3 Writing recipes</h3>
<a name="index-writing-recipes"></a>

<p>Originally, qi was designed for the version 3 of Dragora GNU/Linux (this
does not mean that you can&rsquo;t use it in another distribution, just that
if you do you will need to test it for your selves).  To aid this here
are some references to well written recipes:
</p>
<p><a href="http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>.
<a href="http://notabug.org/dragora/dragora/src/master/recipes">http://notabug.org/dragora/dragora/src/master/recipes</a>.
</p>
<p>You can also check the &quot;doc&quot; directory in the distribution sources of qi
for some examples.
</p>
<a name="Building-packages"></a>
<h3 class="section">5.4 Building packages</h3>
<a name="index-package-build"></a>

<p>A recipe is any valid regular file.  Qi sets priorities for reading a
recipe, the order in which qi looks for a recipe is:
</p>
<ol>
<li> Current working directory.

</li><li> If the specified path name does not contain &quot;recipe&quot; as the last
component.  Qi will complete it by adding &quot;recipe&quot; to the path name.

</li><li> If the recipe is not in the current working directory, it will be
searched under &lsquo;<samp>${worktree}/recipes</samp>&rsquo;.  The last component will be
completed adding &quot;recipe&quot; to the specified path name.
</li></ol>

<p>To build a single package, type:
</p>
<div class="example">
<pre class="example">qi -b x-apps/xterm
</pre></div>

<p>Multiple jobs can be passed to the compiler to speed up the build process:
</p>
<div class="example">
<pre class="example">qi -b -j3 x-apps/xterm
</pre></div>

<p>Update or install the package produced (if it is not already installed)
when finish:
</p>
<div class="example">
<pre class="example">qi -b -j3 -u x-apps/xterm
</pre></div>

<p>Only process a recipe but do not create the binary package:
</p>
<div class="example">
<pre class="example">qi -b -n dict/aspell
</pre></div>

<p>The options -i or -u have no effect when -n is given.
</p>
<p>This can be useful to inspect the build process of recipe:
</p>
<p>qi -b -k -n dict/aspell 2&gt;&amp;1 | tee aspell-buildlog.txt
</p>
<p>The -k option could preserve the source directory and the destination
directory for later inspection.  A log file of the build process will be
created redirecting both, standard error and standard output to tee(1).
</p>
<a name="Variables-from-the-environment"></a>
<h3 class="section">5.5 Variables from the environment</h3>
<a name="index-environment-variables"></a>

<p>Qi has environment variables which can be used at build time:
</p>
<p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
prepended to the value of &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; in
build mode.  By convention its default value is equal to
&lsquo;<samp>/usr/src/qi/build</samp>&rsquo;.
</p>
<p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, and <code>QILDFLAGS</code> have
no effect by default.  The environment variables such as <code>CFLAGS</code>,
<code>CXXFLAGS</code>, and <code>LDFLAGS</code> are unset at compile time:
</p>
<p>Recommended practice is to set variables in the command line of
&lsquo;<samp>configure</samp>&rsquo; or <em>make(1)</em> instead of exporting to the
environment.  As follows:
</p>
<blockquote>
<p>Variables not defined in a site shell script can be set in the environment
passed to configure.  However, some packages may run configure again
during the build, and the customized values of these variables may be
lost.  In order to avoid this problem, you should set them in the
configure command line, using &lsquo;<samp>VAR=value</samp>&rsquo;.  For example:
</p>
<p><code>./configure CC=/usr/local2/bin/gcc</code>
</p>
<p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
</p></blockquote>

<blockquote>
<p>Indeed, while configure can notice the definition of CC in
&lsquo;<samp>./configure CC=bizarre-cc</samp>&rsquo;, it is impossible to notice it in
&lsquo;<samp>CC=bizarre-cc ./configure</samp>&rsquo;, which, unfortunately, is what most
users do.
</p>
<p>[...]
</p>
<p>configure: error: changes in the environment can compromise the build.
</p>
<p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
</p></blockquote>

<blockquote>
<p>It is not wise for makefiles to depend for their functioning on
environment variables set up outside their control, since this would cause
different users to get different results from the same makefile.  This is
against the whole purpose of most makefiles.
</p>
<p><a href="http://gnu.org/software/make/manual/make.html#Environment">http://gnu.org/software/make/manual/make.html#Environment</a>
</p></blockquote>

<a name="The-meta-file"></a>
<h3 class="section">5.6 The meta file</h3>
<a name="index-the-meta-file"></a>

<p>The &quot;meta file&quot; is a regular file created during the build mode, it
contains information about the package such as package name, package
version, architecture, release, fetch address, description, and other
minor data extracted from processed recipes.  The name of the file is
generated as &lsquo;<samp>${full_pkgname}.tlz.txt</samp>&rsquo;, and its purpose is to
reflect essential information to the user without having to look inside
the package content.  The file format is also intended to be imported
from other scripts.
</p>
<p>The content of a meta file looks like:
</p>
<div class="example">
<pre class="example">#
# The Bourne Again SHell.
#
# Bash is an sh-compatible shell that incorporates useful features from
# the Korn shell (ksh) and C shell (csh).  It is intended to conform to
# the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
#
# It offers functional improvements over sh for both programming and
# interactive use.
#

QICFLAGS=&quot;-g0 -Os -mtune=generic -pipe&quot;
QICXXFLAGS=&quot;-g0 -Os -mtune=generic -pipe&quot;
QILDFLAGS=&quot;-s&quot;
pkgname=bash
pkgversion=5.0
arch=x86_64
release=1
blurb=&quot;The Bourne Again SHell.&quot;
homepage=&quot;http://www.gnu.org/software/bash&quot;
license=&quot;GPLv3+&quot;
fetch=&quot;ftp://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz&quot;
replace=&quot;&quot;
</pre></div>

<p>Package descriptions are extracted from the variable &lsquo;<samp>description</samp>&rsquo;
where each line is interpreted literally and pre-formatted to fit in
(exactly) <strong>80 columns</strong>, plus the character &lsquo;<samp>#</samp>&rsquo; and a space
is prefixed to every line.
</p>
<p>In addition to the Special variables, there are implicit variables such as
&lsquo;<samp>blurb</samp>&rsquo;:
</p>
<p>The &lsquo;<samp>blurb</samp>&rsquo; variable is related to the special variable
&lsquo;<samp>description</samp>&rsquo;.  Its value is composed using the first (substantial)
line of &lsquo;<samp>description</samp>&rsquo;, mentioned as the &quot;brief description&quot;.
</p>

<hr>
<a name="Order-files"></a>
<div class="header">
<p>
Next: <a href="#Creating-packages" accesskey="n" rel="next">Creating packages</a>, Previous: <a href="#Recipes" accesskey="p" rel="prev">Recipes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Order-files-1"></a>
<h2 class="chapter">6 Order files</h2>
<a name="index-handling-build-order"></a>

<p>The order mode has the purpose of resolving the build order through
.order files.  An order file contains a list of recipe names, by default
does not perform any action other than to print a resolved list in
descending order.  For example, if <strong>a</strong> depends on <strong>b</strong> and
<strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
look like:
</p>
<div class="example">
<pre class="example">a: c b
b:
c: b
</pre></div>

<p>Each letter represents a recipe name, complete dependencies for
the first recipe name are listed in descending order, which is
printed from right to left, and removed from left to right:
</p>
<p><small>OUTPUT</small>
</p>
<div class="example">
<pre class="example">b
c
a
</pre></div>

<p>Blank lines, colons and parentheses are simply ignored.  Comment lines
beginning with &lsquo;<samp>#</samp>&rsquo; are allowed.
</p>
<p>An order file could be used to build a series of packages, for example,
if the content is:
</p>
<div class="example">
<pre class="example"># Image handling libraries

libs/libjpeg-turbo: devel/nasm
x-libs/jasper: libs/libjpeg-turbo
libs/tiff: libs/libjpeg-turbo
</pre></div>

<p>To proceed with each recipe, we can type:
</p>
<div class="example">
<pre class="example">qi -o imglibs.order | qi -b -i -
</pre></div>

<p>The output of &lsquo;<samp>qi -o imglibs.order</samp>&rsquo; tells to qi in which order it
should build the recipes:
</p>
<div class="example">
<pre class="example">devel/nasm
libs/libjpeg-turbo
x-libs/jasper
libs/tiff
</pre></div>


<hr>
<a name="Creating-packages"></a>
<div class="header">
<p>
Next: <a href="#Examining-packages" accesskey="n" rel="next">Examining packages</a>, Previous: <a href="#Order-files" accesskey="p" rel="prev">Order files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Creating-packages-1"></a>
<h2 class="chapter">7 Creating packages</h2>
<a name="index-package-creation"></a>

<p>The &quot;creation mode&quot; is an internal function of qi to make new Qi compatible
compatible packages, the creation mode is selected by the -c option.
A package is produced using the contents of the Current Directory, and
the package file is written out.
</p>
<div class="example">
<pre class="example">Usage: qi -c [<var>OUTPUT/packagename.tlz</var>]...
</pre></div>

<p>The argument for the file name to be written must contain a fully
qualified named directory as the output directory where the package
produced will be written.  The file name should be composed using the
full name: name-version-architecture+release.tlz
</p>
<p><small>EXAMPLE</small>
</p>
<div class="example">
<pre class="example">cd /usr/local/pkgs
cd claws-mail-3.17.1-x86_64+1
qi -c /var/cache/qi/packages/x86_64/local/claws-mail-3.17.1-x86_64+1.tlz
</pre></div>

<p>In this case, the package &quot;claws-mail-3.17.1-x86_64+1.tlz&quot; will be written
into &lsquo;<samp>/var/cache/qi/packages/x86_64/local/</samp>&rsquo;.
</p>
<p>All packages produced are complemented by a checksum file (.sha256).
</p>

<hr>
<a name="Examining-packages"></a>
<div class="header">
<p>
Next: <a href="#Exit-status" accesskey="n" rel="next">Exit status</a>, Previous: <a href="#Creating-packages" accesskey="p" rel="prev">Creating packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Examining-packages-1"></a>
<h2 class="chapter">8 Examining packages</h2>
<a name="index-package-examination"></a>

<p>The &quot;extraction mode&quot; serves to examine binary packages for debugging
purposes. The extraction mode is selected by the -x option.  It
decompresses a package into a single directory, verifying its integrity
and preserving its properties.
</p>
<div class="example">
<pre class="example">Usage: qi -x [<var>packagename.tlz</var>]...
</pre></div>

<p><small>EXAMPLE</small>
</p>
<div class="example">
<pre class="example">qi -x mksh-R56c-x86_64+1.tlz
</pre></div>

<p>This action will put the content of &quot;mksh-R56c-x86_64+1.tlz&quot; into a
single directory, this will be a private directory for the user who
</p>
<p>requested the action, creation mode will be equal to <strong>u=rwx,g=,o=
(0700)</strong>.  The package content will reside on this location, default
mask to deploy the content will be equal to
<strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
</p>
<p>The creation of the custom directory is influenced by the value of the
<code>TMPDIR</code> variable.
</p>

<hr>
<a name="Exit-status"></a>
<div class="header">
<p>
Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Examining-packages" accesskey="p" rel="prev">Examining packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Exit-status-1"></a>
<h2 class="chapter">9 Exit status</h2>
<a name="index-exit-codes"></a>

<p>All the exit codes are described in this chapter.
</p>
<dl compact="compact">
<dt>&lsquo;<samp>0</samp>&rsquo;</dt>
<dd><p>Successful completion (no errors).
</p>
</dd>
<dt>&lsquo;<samp>1</samp>&rsquo;</dt>
<dd><p>Minor common errors:
</p>
<ul class="no-bullet">
<li>- Help usage on illegal options or required arguments.

</li><li>- Program needed by qi (prerequisite) is not available.
</li></ul>

</dd>
<dt>&lsquo;<samp>2</samp>&rsquo;</dt>
<dd><p>Command execution error:
</p>
<p>This code is used to return the evaluation of external commands and shell
arguments in case of error.
</p>
</dd>
<dt>&lsquo;<samp>3</samp>&rsquo;</dt>
<dd><p>Integrity check error for compressed files.
</p>
<p>Compressed files means:
</p>
<ul class="no-bullet">
<li>- Tarball files from tar(1).
Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
.tar.xz, .txz

</li><li>- Tarball files from tarlz(1).
Supported extensions: .tar.lz, .tlz

</li><li>- Zip files from unzip(1).
Supported extensions: .zip, .ZIP

</li><li>- Gzip files from gzip(1).
Supported extensions: .gz, .Z

</li><li>- Bzip2 files from bzip2(1).
Supported extensions: .bz2

</li><li>- Lzip files from lzip(1).
Supported extensions: .lz

</li><li>- Xz files from xz(1).
Supported extensions: .xz
</li></ul>

</dd>
<dt>&lsquo;<samp>4</samp>&rsquo;</dt>
<dd><p>File empty, not regular, or expected.
</p>
<p>Commonly, it is expected:
</p>
<ul class="no-bullet">
<li>- An argument for the mode of operation.

</li><li>- A readable file or directory.

</li><li>- A binary package (.tlz).

</li><li>- A valid recipe.

</li><li>- An order file (.order).

</li><li>- A protocol supported by the network downloader tool.

</li><li>- A checksum file (.sha256).
</li></ul>

</dd>
<dt>&lsquo;<samp>5</samp>&rsquo;</dt>
<dd><p>Empty or not defined variable:
</p>
<p>This code is used to report empty or undefined variables; usually,
variables coming from a recipe or assigned arrays that are tested.
</p>
</dd>
<dt>&lsquo;<samp>6</samp>&rsquo;</dt>
<dd><p>Package already installed:
</p>
<p>The package directory for an incoming .tlz package already exists.
</p>
</dd>
<dt>&lsquo;<samp>10</samp>&rsquo;</dt>
<dd><p>Network manager error:
</p>
<p>This code is used if the network downloader tool fails for some reason.
</p></dd>
</dl>


<hr>
<a name="Index"></a>
<div class="header">
<p>
Previous: <a href="#Exit-status" accesskey="p" rel="prev">Exit status</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Index-1"></a>
<h2 class="unnumbered">Index</h2>

<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
 &nbsp; 
</td></tr></table>
<table class="index-cp" border="0">
<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-configuration-file">configuration file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-qirc-file">The qirc file</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-environment-variables">environment variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exit-codes">exit codes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Exit-status">Exit status</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-handling-build-order">handling build order</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Order-files">Order files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-introduction">introduction</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Introduction">Introduction</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-invocation">invocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Invoking-qi">Invoking qi</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-managing-packages">managing packages</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-blacklist">package blacklist</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-build">package build</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-conflicts">package conflicts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-creation">package creation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Creating-packages">Creating packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-de_002dinstallation">package de-installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-examination">package examination</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Examining-packages">Examining packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-installation">package installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-package-upgrade">package upgrade</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-recipes">recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-special-variables">special variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-the-meta-file">the meta file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-variables">variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-writing-recipes">writing recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
 &nbsp; 
<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
 &nbsp; 
</td></tr></table>

<div class="footnote">
<hr>
<h4 class="footnotes-heading">Footnotes</h4>

<h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
<p>The official guide for Graft can be found at
<a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
<h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
<p>The proposal for &lsquo;<samp>license</samp>&rsquo; was made by Richard M. Stallman at
<a href="http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>
</div>
<hr>



</body>
</html>
